package com.vogue.supplymall.admin.business.domain.service.impl;

import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.admin.business.domain.dao.AdminOrganDao;
import com.vogue.supplymall.admin.business.domain.model.AdminOrgan;
import com.vogue.supplymall.admin.business.domain.service.AdminOrganService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The type Admin organ service.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-04-26
 */
@Service("adminOrganService")
public class AdminOrganServiceImpl extends BaseServiceImpl<AdminOrgan, Long> implements AdminOrganService {
    @Resource
    private AdminOrganDao adminOrganDao;

    /**
     * Instantiates a new Admin organ service.
     *
     * @param baseDao the base dao
     */
    public AdminOrganServiceImpl(BaseDao<AdminOrgan, Long> baseDao) {
        super(baseDao);
    }

    @Override
    public List<Map<String, Object>> getAdminOrganBySyscode(Long syscode) {
        String sql = "select * from admin_organ where syscode = #{syscode}";
        Map<String, Object> para = new HashMap<>();
        para.put("syscode", syscode);
        return adminOrganDao.query0(sql, para);
    }

	@Override
	public List<Map<String, Object>> getPlatFormByST(Long syscode, String tel) {
		Map<String, Object> paramMap=new HashMap<>();
		List<Map<String, Object>> resultList=new ArrayList<>();
		
		paramMap.put("syscode", syscode);
		paramMap.put("tel", tel);		
		String sql=adminOrganDao.getPlatFormByST();
		resultList=this.query0(sql, paramMap);
		
		return resultList;
	}

	@Override
	public List<Map<String, Object>> getAdminDict() {
		String sql=adminOrganDao.getAdminDict();
		List<Map<String, Object>> resultList=this.query(sql);
		
		return resultList;
	}
    
    
}
